package homework;

import java.util.Random;
import java.util.Scanner;

public class homework2 {
    public static void main(String[] args){
        Random random=new Random();
        int r=random.nextInt(100)+1;
        Scanner scan=new Scanner(System.in);
        while(true){
            System.out.println("输入数字：");
            int x=scan.nextInt();
            if(x==r){
                System.out.println("猜中了");
                break;
            }else if(x>r){
                System.out.println("猜大了");
            }else{
                System.out.println("猜小了");
            }
        }
    }
}
